<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><title>Usage - jQuery::dForm 0.1.3</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.5 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CFile"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="Usage"></a>Usage</h1><div class=CBody><p>Subscribers are the core concept of the jQuery.dForm.</p><p>They are functions, that will be called when traversing the options passed to the plugin.&nbsp; You can use the already existing subscribers as well as register your own.</p><p>The plugin has three different types of subscribers</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>Types</td><td class=CDLDescription>For creating a new element of the given type.</td></tr><tr><td class=CDLEntry>Subscribers</td><td class=CDLDescription>Which will be called when the name they are registered with appears in the options given to the plugin and after the type element has been added to the DOM.</td></tr><tr><td class=CDLEntry>Special subscribers</td><td class=CDLDescription>Will be called on special events.</td></tr></table><p>Currently there are two types of special subscribers</p><ul><li>[pre] - Functions registered with this name will be called before any processing occurs.</li><li>[post] - Functions registered with this name will be called after all processing is finished.</li></ul><h4 class=CHeading>Example</h4><blockquote><pre>$(&quot;#myform&quot;).buildForm({
     &quot;name&quot; : &quot;textfield&quot;,
     &quot;type&quot; : &quot;text&quot;,
     &quot;id&quot; : &quot;testid&quot;,
     &quot;value&quot; : &quot;Testvalue&quot;,
     &quot;caption&quot; : &quot;Label for textfield&quot;
});</pre></blockquote><p>The above JavaScript snippet will do the following</p><ul><li>Look for a type subscriber called <a href="#text" class=LType id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">text</a>, which creates an input field with the type text or, if there is no matching type call the <a href="dform-js.html#defaultType" class=LFunction id=link3 onMouseOver="ShowTip(event, 'tt1', 'link3')" onMouseOut="HideTip('tt1')">defaultType</a> function which creates a HTML tag of the given type.</li><li>Add all attributes as HTML attributes to the input element that don&rsquo;t have a subscriber registered (which are name and id)</li><li>Add the new element to the DOM (append to #myform).</li><li>Run the <a href="#type" class=LSubscriber id=link4 onMouseOver="ShowTip(event, 'tt3', 'link4')" onMouseOut="HideTip('tt3')">type</a> subscriber which adds the auto generated class name ui-dform-text to the input field</li><li>Run the <a href="#value" class=LSubscriber id=link5 onMouseOver="ShowTip(event, 'tt4', 'link5')" onMouseOut="HideTip('tt4')">value</a> subscriber which sets the value of this form element</li><li>Run the <a href="#caption" class=LSubscriber id=link6 onMouseOver="ShowTip(event, 'tt5', 'link6')" onMouseOut="HideTip('tt5')">caption</a> subscriber which adds a label before the textfield</li></ul><p>Read in the <a href="dform-extensions-js.html#Extension" class=LFile id=link7 onMouseOver="ShowTip(event, 'tt6', 'link7')" onMouseOut="HideTip('tt6')">Extensions</a> chapter, how you can extend the dForm Plugin with your own types and subscribers.</p><p>This page will list the basic <a href="#Types" class=LGroup >Types</a> and <a href="#Subscribers" class=LGroup >Subscribers</a> that are supported by the plugin as well as examples for using them.</p><h4 class=CHeading>Author</h4><p>David Luecke (<a href="#" onClick="location.href='mai' + 'lto:' + 'da' + 'ff' + '@' + 'neye' + 'on.de'; return false;" class=LEMail>da<span style="display: none">.nosp@m.</span>ff<span>@</span>neye<span style="display: none">.nosp@m.</span>on.de</a>)</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#Usage" >Usage</a></td><td class=SDescription>Subscribers are the core concept of the jQuery.dForm.</td></tr><tr class="SGroup"><td class=SEntry><a href="#Types" >Types</a></td><td class=SDescription></td></tr><tr class="SType SIndent1 SMarked"><td class=SEntry><a href="#Default_types_and_attributes" >Default types and attributes</a></td><td class=SDescription>Default types are handled by the <a href="dform-js.html#defaultType" class=LFunction id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">defaultType</a> function. </td></tr><tr class="SType SIndent1"><td class=SEntry><a href="#container" >container</a></td><td class=SDescription>Returns an empty container (div) for general use</td></tr><tr class="SType SIndent1 SMarked"><td class=SEntry><a href="#form" >form</a></td><td class=SDescription>Type function that creates a form. </td></tr><tr class="SType SIndent1"><td class=SEntry><a href="#text" >text</a></td><td class=SDescription>Type function that creates a text input field</td></tr><tr class="SType SIndent1 SMarked"><td class=SEntry><a href="#password" >password</a></td><td class=SDescription>Type function that creates a password input field</td></tr><tr class="SType SIndent1"><td class=SEntry><a href="#select" >select</a></td><td class=SDescription>Creates a select input element</td></tr><tr class="SType SIndent1 SMarked"><td class=SEntry><a href="#fieldset" >fieldset</a></td><td class=SDescription>Creates an empty fieldset to contain other elements</td></tr><tr class="SType SIndent1"><td class=SEntry><a href="#textarea" >textarea</a></td><td class=SDescription>Creates a textarea</td></tr><tr class="SType SIndent1 SMarked"><td class=SEntry><a href="#submit" >submit</a></td><td class=SDescription>Creates a form submit button</td></tr><tr class="SType SIndent1"><td class=SEntry><a href="#reset" >reset</a></td><td class=SDescription>Creates a form reset button</td></tr><tr class="SType SIndent1 SMarked"><td class=SEntry><a href="#label" >label</a></td><td class=SDescription>Creates an empty label element</td></tr><tr class="SType SIndent1"><td class=SEntry><a href="#button" >button</a></td><td class=SDescription>Creates a button element</td></tr><tr class="SType SIndent1 SMarked"><td class=SEntry><a href="#hidden" >hidden</a></td><td class=SDescription>Creates a hidden input field</td></tr><tr class="SType SIndent1"><td class=SEntry><a href="#radio" >radio</a></td><td class=SDescription>Creates a single radio button</td></tr><tr class="SType SIndent1 SMarked"><td class=SEntry><a href="#checkbox" >checkbox</a></td><td class=SDescription>Creates a single checkbox</td></tr><tr class="SType SIndent1"><td class=SEntry><a href="#checkboxes" >checkboxes</a></td><td class=SDescription>Returns an empty container for a checkbox list</td></tr><tr class="SType SIndent1 SMarked"><td class=SEntry><a href="#radiobuttons" >radiobuttons</a></td><td class=SDescription>Returns an empty container for a radiobutton list</td></tr><tr class="SType SIndent1"><td class=SEntry><a href="#file" >file</a></td><td class=SDescription>Returns a file upload input element</td></tr><tr class="SGroup"><td class=SEntry><a href="#Subscribers" >Subscribers</a></td><td class=SDescription></td></tr><tr class="SSubscriber SIndent1 SMarked"><td class=SEntry><a href="#class" >class</a></td><td class=SDescription>Adds a class to the current element.</td></tr><tr class="SSubscriber SIndent1"><td class=SEntry><a href="#html" >html</a></td><td class=SDescription>Sets html content of the current element</td></tr><tr class="SSubscriber SIndent1 SMarked"><td class=SEntry><a href="#elements" >elements</a></td><td class=SDescription>Recursively appends subelements to the current form element.</td></tr><tr class="SSubscriber SIndent1"><td class=SEntry><a href="#value" >value</a></td><td class=SDescription>Sets the value of the current element.</td></tr><tr class="SSubscriber SIndent1 SMarked"><td class=SEntry><a href="#options" >options</a></td><td class=SDescription>Adds options to select type elements or radio and checkbox list elements.</td></tr><tr class="SSubscriber SIndent1"><td class=SEntry><a href="#caption" >caption</a></td><td class=SDescription>Adds caption to elements.</td></tr><tr class="SSubscriber SIndent1 SMarked"><td class=SEntry><a href="#type" >type</a></td><td class=SDescription>The subscriber for the type parameter. </td></tr><tr class="SSubscriber SIndent1"><td class=SEntry><a href="#[post]" >[post]</a></td><td class=SDescription>Post processing function, that will run whenever all other subscribers are finished.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Types"></a>Types</h3></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="Default_types_and_attributes"></a>Default types and attributes</h3><div class=CBody><p>Default types are handled by the <a href="dform-js.html#defaultType" class=LFunction id=link8 onMouseOver="ShowTip(event, 'tt1', 'link8')" onMouseOut="HideTip('tt1')">defaultType</a> function.&nbsp; Its standard behaviour allows you to create any HTML tag with standard attributes (attributes are any key value pair in the given options, where the key is not any of the <a href="#Subscribers" class=LGroup >Subscribers</a>).</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>An input element with type text</p><h4 class=CHeading>Example</h4><p>Uses the <a href="#elements" class=LSubscriber id=link9 onMouseOver="ShowTip(event, 'tt7', 'link9')" onMouseOut="HideTip('tt7')">elements</a> and <a href="#html" class=LSubscriber id=link10 onMouseOver="ShowTip(event, 'tt8', 'link10')" onMouseOut="HideTip('tt8')">html</a> subscribers to create a div with an h2 heading inside.</p><blockquote><pre>{
     &quot;type&quot; : &quot;div&quot;,
     &quot;id&quot; : &quot;my-div&quot;,
     &quot;class&quot; : &quot;ui-widget-content ui-corner-all&quot;,
     &quot;style&quot; : &quot;padding: 10px&quot;,
     &quot;elements&quot; :
     [
         {
             &quot;type&quot; : &quot;h2&quot;,
             &quot;html&quot; : &quot;A H2 heading in a div with corners&quot;
         }
     ]
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="container"></a>container</h3><div class=CBody><p>Returns an empty container (div) for general use</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>An empty div</p><h4 class=CHeading>Example</h4><p>Uses the style property although you should separate your CSS</p><blockquote><pre>{
     &quot;type&quot; : &quot;container&quot;,
     &quot;html&quot; : &quot;Text in div&quot;
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="form"></a>form</h3><div class=CBody><p>Type function that creates a form.&nbsp; If no type is given for the root element, a form will be created automatically.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>A form element</p><h4 class=CHeading>Example</h4><blockquote><pre>{
     &quot;type&quot; : &quot;form&quot;,
     &quot;action&quot; : &quot;index.php&quot;
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="text"></a>text</h3><div class=CBody><p>Type function that creates a text input field</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>An input element with type text</p><h4 class=CHeading>Example</h4><p>Uses the <a href="#value" class=LSubscriber id=link11 onMouseOver="ShowTip(event, 'tt4', 'link11')" onMouseOut="HideTip('tt4')">value</a> subscriber to set the textfield value</p><blockquote><pre>{
     &quot;name&quot; : &quot;textfield&quot;,
     &quot;type&quot; : &quot;text&quot;,
     &quot;id&quot; : &quot;my-textfield&quot;,
     &quot;value&quot; : &quot;Hello world&quot;
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="password"></a>password</h3><div class=CBody><p>Type function that creates a password input field</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>An input element with type password</p><h4 class=CHeading>Example</h4><blockquote><pre>{
     &quot;name&quot; : &quot;password&quot;,
     &quot;type&quot; : &quot;password&quot;
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="select"></a>select</h3><div class=CBody><p>Creates a select input element</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>An empty select input</p><h4 class=CHeading>Note</h4><p>This type will be handled by the <a href="dform-js.html#defaultType" class=LFunction id=link12 onMouseOver="ShowTip(event, 'tt1', 'link12')" onMouseOut="HideTip('tt1')">defaultType</a> function.</p><h4 class=CHeading>Example</h4><p>Uses the <a href="#options" class=LSubscriber id=link13 onMouseOver="ShowTip(event, 'tt9', 'link13')" onMouseOut="HideTip('tt9')">options</a> subscriber to add options to the select field</p><blockquote><pre>{
     &quot;type&quot; : &quot;select&quot;,
     &quot;name&quot; : &quot;testselect&quot;,
     &quot;options&quot; :
     {
         &quot;red&quot; : &quot;Color red&quot;,
         &quot;blue&quot; : &quot;Color blue&quot;
     }
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="fieldset"></a>fieldset</h3><div class=CBody><p>Creates an empty fieldset to contain other elements</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>An empty fieldset</p><h4 class=CHeading>Note</h4><p>This type will be handled by the <a href="dform-js.html#defaultType" class=LFunction id=link14 onMouseOver="ShowTip(event, 'tt1', 'link14')" onMouseOut="HideTip('tt1')">defaultType</a> function.</p><h4 class=CHeading>Example</h4><p>Uses the <a href="#caption" class=LSubscriber id=link15 onMouseOver="ShowTip(event, 'tt5', 'link15')" onMouseOut="HideTip('tt5')">caption</a> subscriber to add a legend and the <a href="#elements" class=LSubscriber id=link16 onMouseOver="ShowTip(event, 'tt7', 'link16')" onMouseOut="HideTip('tt7')">elements</a> subscriber to add a &lt;span&gt; element in the fieldset.</p><blockquote><pre>{
     &quot;type&quot; : &quot;fieldset&quot;,
     &quot;id&quot; : &quot;my-fieldset&quot;,
     &quot;caption&quot; :
     {
         &quot;id&quot; : &quot;fieldset-caption&quot;,
         &quot;html&quot; : &quot;Fieldset with elements&quot;
     },
     &quot;elements&quot; :
     [
         {
             &quot;type&quot; : &quot;span&quot;,
             &quot;html&quot; : &quot;Some text in here&quot;
         }
     ]
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="textarea"></a>textarea</h3><div class=CBody><p>Creates a textarea</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>A textarea input element</p><h4 class=CHeading>Note</h4><p>This type will be handled by the <a href="dform-js.html#defaultType" class=LFunction id=link17 onMouseOver="ShowTip(event, 'tt1', 'link17')" onMouseOut="HideTip('tt1')">defaultType</a> function.</p><h4 class=CHeading>Example</h4><blockquote><pre>{
     &quot;type&quot; : &quot;textarea&quot;,
     &quot;cols&quot; : 30,
     &quot;rows&quot; : 10
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="submit"></a>submit</h3><div class=CBody><p>Creates a form submit button</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>A form submit button</p><h4 class=CHeading>Example</h4><blockquote><pre>{
     &quot;type&quot; : &quot;submit&quot;,
     &quot;value&quot; : &quot;Send...&quot;
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="reset"></a>reset</h3><div class=CBody><p>Creates a form reset button</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>A form reset button</p><h4 class=CHeading>Example</h4><blockquote><pre>{
     &quot;action&quot; : &quot;#&quot;,
     &quot;elements&quot; :
     [
         {
             &quot;type&quot; : &quot;text&quot;,
             &quot;name&quot; : &quot;textfield&quot;
         },
         {
             &quot;type&quot; : &quot;reset&quot;,
             &quot;value&quot; : &quot;Reset&quot;
         }
     ]
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="label"></a>label</h3><div class=CBody><p>Creates an empty label element</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>An empty label element</p><h4 class=CHeading>Example</h4><p>Uses the <a href="#html" class=LSubscriber id=link18 onMouseOver="ShowTip(event, 'tt8', 'link18')" onMouseOut="HideTip('tt8')">html</a> element subscriber to add text to the label</p><h4 class=CHeading>Note</h4><p>This type will be handled by the <a href="dform-js.html#defaultType" class=LFunction id=link19 onMouseOver="ShowTip(event, 'tt1', 'link19')" onMouseOut="HideTip('tt1')">defaultType</a> function.</p><blockquote><pre>{
     &quot;type&quot; : &quot;label&quot;,
     &quot;html&quot; : &quot;Label content&quot;
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="button"></a>button</h3><div class=CBody><p>Creates a button element</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>A button element</p><h4 class=CHeading>Example</h4><p>Uses the <a href="#html" class=LSubscriber id=link20 onMouseOver="ShowTip(event, 'tt8', 'link20')" onMouseOut="HideTip('tt8')">html</a> subscriber</p><h4 class=CHeading>Note</h4><p>This type will be handled by the <a href="dform-js.html#defaultType" class=LFunction id=link21 onMouseOver="ShowTip(event, 'tt1', 'link21')" onMouseOut="HideTip('tt1')">defaultType</a> function.</p><blockquote><pre>{
     &quot;type&quot; : &quot;button&quot;,
     &quot;html&quot; : &quot;Send...&quot;
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="hidden"></a>hidden</h3><div class=CBody><p>Creates a hidden input field</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>A hidden input field element</p><h4 class=CHeading>Example</h4><p>This example uses the <a href="#value" class=LSubscriber id=link22 onMouseOver="ShowTip(event, 'tt4', 'link22')" onMouseOut="HideTip('tt4')">value</a> subscriber to set a value to the field.</p><blockquote><pre>{
     &quot;type&quot; : &quot;hidden&quot;,
     &quot;value&quot; : &quot;hiddenvalue&quot;
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="radio"></a>radio</h3><div class=CBody><p>Creates a single radio button</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>A single radio input element</p><h4 class=CHeading>Example</h4><p>Uses the <a href="#caption" class=LSubscriber id=link23 onMouseOver="ShowTip(event, 'tt5', 'link23')" onMouseOut="HideTip('tt5')">caption</a> subscriber to add text to the radiobutton</p><blockquote><pre>{
     &quot;type&quot; : &quot;radio&quot;,
     &quot;name&quot; : &quot;radioselection&quot;,
     &quot;caption&quot; : &quot;Radiobutton&quot;
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="checkbox"></a>checkbox</h3><div class=CBody><p>Creates a single checkbox</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>A single checkbox input element</p><h4 class=CHeading>Example</h4><p>Uses the <a href="#caption" class=LSubscriber id=link24 onMouseOver="ShowTip(event, 'tt5', 'link24')" onMouseOut="HideTip('tt5')">caption</a> subscriber to add text to the checkbox</p><blockquote><pre>{
     &quot;type&quot; : &quot;checkbox&quot;,
     &quot;name&quot; : &quot;checkboxselection&quot;,
     &quot;caption&quot; : &quot;Checkbox&quot;
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="checkboxes"></a>checkboxes</h3><div class=CBody><p>Returns an empty container for a checkbox list</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>An empty div to contain checkbox lists</p><h4 class=CHeading>Example</h4><p>Uses the <a href="#options" class=LSubscriber id=link25 onMouseOver="ShowTip(event, 'tt9', 'link25')" onMouseOut="HideTip('tt9')">options</a> subscriber to add a list of checkboxes</p><blockquote><pre>{
     &quot;type&quot; : &quot;checkboxes&quot;,
     &quot;name&quot; : &quot;radioselection&quot;,
     &quot;options&quot; :
     {
         &quot;red&quot; : &quot;Color red&quot;,
         &quot;blue&quot; : &quot;Color blue&quot;
     }
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="radiobuttons"></a>radiobuttons</h3><div class=CBody><p>Returns an empty container for a radiobutton list</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>An empty div to contain radiobutton lists</p><h4 class=CHeading>Example</h4><p>Uses the <a href="#options" class=LSubscriber id=link26 onMouseOver="ShowTip(event, 'tt9', 'link26')" onMouseOut="HideTip('tt9')">options</a> subscriber to add a list of radiobuttons</p><blockquote><pre>{
     &quot;type&quot; : &quot;radiobuttons&quot;,
     &quot;name&quot; : &quot;radioselection&quot;,
     &quot;options&quot; :
     {
         &quot;red&quot; : &quot;Color red&quot;,
         &quot;blue&quot; : &quot;Color blue&quot;
     }
}</pre></blockquote></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="file"></a>file</h3><div class=CBody><p>Returns a file upload input element</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The options this element should be created with</td></tr></table><h4 class=CHeading>Returns</h4><p>A file upload element</p><h4 class=CHeading>Example</h4><blockquote><pre>{
     &quot;type&quot; : &quot;file&quot;,
     &quot;name&quot; : &quot;upload&quot;
}</pre></blockquote></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Subscribers"></a>Subscribers</h3></div></div>

<div class="CSubscriber"><div class=CTopic><h3 class=CTitle><a name="class"></a>class</h3><div class=CBody><p>Adds a class to the current element.</p><p>Ovverrides the default behaviour which would be replacing the class attribute.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>A list of whitespace separated classnames</td></tr><tr><td class=CDLEntry>type</td><td class=CDLDescription>The type of the <b>this</b> element</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre>{
     &quot;type&quot; : &quot;text&quot;,
     &quot;class&quot; : &quot;ui-corner-all ui-widget&quot;
}</pre></blockquote></div></div></div>

<div class="CSubscriber"><div class=CTopic><h3 class=CTitle><a name="html"></a>html</h3><div class=CBody><p>Sets html content of the current element</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>The html content to set as a string</td></tr><tr><td class=CDLEntry>type</td><td class=CDLDescription>The type of the <b>this</b> element</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre>{
     &quot;type&quot; : &quot;span&quot;,
     &quot;html&quot; : &quot;Some html content&quot;
}</pre></blockquote></div></div></div>

<div class="CSubscriber"><div class=CTopic><h3 class=CTitle><a name="elements"></a>elements</h3><div class=CBody><p>Recursively appends subelements to the current form element.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>Either an object with key value pairs where the key is the element name and the value the subelement options or an array of objects where each object is the options for a subelement</td></tr><tr><td class=CDLEntry>type</td><td class=CDLDescription>The type of the <b>this</b> element</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre>{
     &quot;type&quot; : &quot;fieldset&quot;,
     &quot;caption&quot; : &quot;Fieldset with elements&quot;,
     &quot;elements&quot; :
     [
         {
             &quot;name&quot; : &quot;textfield&quot;,
             &quot;type&quot; : &quot;text&quot;,
             &quot;id&quot; : &quot;my-textfield&quot;,
             &quot;caption&quot; : &quot;My textfield&quot;
         }
     ]
}</pre></blockquote></div></div></div>

<div class="CSubscriber"><div class=CTopic><h3 class=CTitle><a name="value"></a>value</h3><div class=CBody><p>Sets the value of the current element.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>string The value to set</td></tr><tr><td class=CDLEntry>type</td><td class=CDLDescription>string The type of the <b>this</b> element</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre>{
     &quot;name&quot; : &quot;textfield&quot;,
     &quot;type&quot; : &quot;text&quot;,
     &quot;value&quot; : &quot;Value in Textfield&quot;
}</pre></blockquote></div></div></div>

<div class="CSubscriber"><div class=CTopic><h3 class=CTitle><a name="options"></a>options</h3><div class=CBody><p>Adds options to select type elements or radio and checkbox list elements.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>A key value pair where the key is the option value and the value the options text or the settings for the element.</td></tr><tr><td class=CDLEntry>type</td><td class=CDLDescription>The type of the <b>this</b> element</td></tr></table><h4 class=CHeading>For types</h4><p><a href="#select" class=LType id=link27 onMouseOver="ShowTip(event, 'tt10', 'link27')" onMouseOut="HideTip('tt10')">select</a>, <a href="#checkboxes" class=LType id=link28 onMouseOver="ShowTip(event, 'tt11', 'link28')" onMouseOut="HideTip('tt11')">checkboxes</a>, <a href="#radiobuttons" class=LType id=link29 onMouseOver="ShowTip(event, 'tt12', 'link29')" onMouseOut="HideTip('tt12')">radiobuttons</a></p><h4 class=CHeading>Example</h4><blockquote><pre>{
     &quot;type&quot; : &quot;select&quot;,
     &quot;name&quot; : &quot;testselect&quot;,
     &quot;options&quot; :
     {
         &quot;option1&quot; : &quot;Option no. 1&quot;,
         &quot;option2&quot; : &quot;Option no. 2&quot;
     }
}</pre></blockquote><h4 class=CHeading>Todo</h4><p>Option groups</p></div></div></div>

<div class="CSubscriber"><div class=CTopic><h3 class=CTitle><a name="caption"></a>caption</h3><div class=CBody><p>Adds caption to elements.</p><p>Depending on the element type the following elements will be used:</p><ul><li>A legend for <a href="#fieldset" class=LType id=link30 onMouseOver="ShowTip(event, 'tt13', 'link30')" onMouseOut="HideTip('tt13')">fieldset</a> elements</li><li>A <a href="#label" class=LType id=link31 onMouseOver="ShowTip(event, 'tt14', 'link31')" onMouseOut="HideTip('tt14')">label</a> next to <a href="#radio" class=LType id=link32 onMouseOver="ShowTip(event, 'tt15', 'link32')" onMouseOut="HideTip('tt15')">radio</a> or <a href="#checkbox" class=LType id=link33 onMouseOver="ShowTip(event, 'tt16', 'link33')" onMouseOut="HideTip('tt16')">checkbox</a> elements</li><li>A <a href="#label" class=LType id=link34 onMouseOver="ShowTip(event, 'tt14', 'link34')" onMouseOut="HideTip('tt14')">label</a> before any other element</li></ul><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>A string for the caption or the options for the element created</td></tr><tr><td class=CDLEntry>type</td><td class=CDLDescription>The type of the <b>this</b> element</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre>{
     &quot;type&quot; : &quot;fieldset&quot;,
     &quot;caption&quot; : &quot;Use of caption&quot;,
     &quot;elements&quot; :
     [
         {
             &quot;name&quot; : &quot;email&quot;,
             &quot;type&quot; : &quot;text&quot;,
             &quot;caption&quot; : &quot;Enter your email address&quot;
         },
         {
             &quot;type&quot; : &quot;checkbox&quot;,
             &quot;name&quot; : &quot;mycheckbox&quot;,
             &quot;caption&quot; : &quot;Checkbox caption&quot;
         }
     ]
}</pre></blockquote></div></div></div>

<div class="CSubscriber"><div class=CTopic><h3 class=CTitle><a name="type"></a>type</h3><div class=CBody><p>The subscriber for the type parameter.&nbsp; Although the type parameter is used to get the correct element type it is just treated as a simple subscriber otherwise.&nbsp; Since every element needs a type parameter feel free to add other type subscribers to do any processing between [pre] and [post].</p><p>This subscriber adds the auto generated classes according to the type given.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>the name of the type.</td></tr><tr><td class=CDLEntry>type</td><td class=CDLDescription>The type of the <b>this</b> element</td></tr></table></div></div></div>

<div class="CSubscriber"><div class=CTopic><h3 class=CTitle><a name="[post]"></a>[post]</h3><div class=CBody><p>Post processing function, that will run whenever all other subscribers are finished.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>options</td><td class=CDLDescription>mixed All options that have been used for creating the current element.</td></tr><tr><td class=CDLEntry>type</td><td class=CDLDescription>The type of the <b>this</b> element</td></tr></table></div></div></div>

</div><!--Content-->


<div id=Footer>Copyright &copy; 2011 - David Luecke - daff@neyeon.de&nbsp; &middot;&nbsp; <a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MTitle>jQuery::dForm 0.1.3</div><div class=MEntry><div class=MFile><a href="../files2/readme-txt.html">Home</a></div></div><div class=MEntry><div class=MFile><a href="../files2/examples-txt.html">Examples</a></div></div><div class=MEntry><div class=MFile id=MSelected>Usage</div></div><div class=MEntry><div class=MFile><a href="dform-extensions-js.html">Extension</a></div></div><div class=MEntry><div class=MFile><a href="dform-js.html">Plugin</a></div></div><div class=MEntry><div class=MFile><a href="../files2/changelog-txt.html">Changelog</a></div></div><div class=MEntry><div class=MFile><a href="../files2/license-txt.html">License</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Index</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MIndex><a href="../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Types.html">Types</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Subscribers.html">Subscribers</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Files.html">Files</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Examples.html">Examples</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Variables.html">Variables</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Examples">Examples</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Subscribers">Subscribers</option><option value="Types">Types</option><option value="Variables">Variables</option></select></div></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>defaultType : function(</td><td class=PParameter nowrap>options</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>A function that is called, when no registered type has been found. </div></div><div class=CToolTip id="tt2"><div class=CType>Type function that creates a text input field</div></div><div class=CToolTip id="tt3"><div class=CSubscriber>The subscriber for the type parameter. </div></div><div class=CToolTip id="tt4"><div class=CSubscriber>Sets the value of the current element.</div></div><div class=CToolTip id="tt5"><div class=CSubscriber>Adds caption to elements.</div></div><div class=CToolTip id="tt6"><div class=CFile>This page covers how to extend the dform plugin of your own types and subscribers as well as providing a documentation for form related jQuery plugins that are already supported out of the box.</div></div><div class=CToolTip id="tt7"><div class=CSubscriber>Recursively appends subelements to the current form element.</div></div><div class=CToolTip id="tt8"><div class=CSubscriber>Sets html content of the current element</div></div><div class=CToolTip id="tt9"><div class=CSubscriber>Adds options to select type elements or radio and checkbox list elements.</div></div><div class=CToolTip id="tt10"><div class=CType>Creates a select input element</div></div><div class=CToolTip id="tt11"><div class=CType>Returns an empty container for a checkbox list</div></div><div class=CToolTip id="tt12"><div class=CType>Returns an empty container for a radiobutton list</div></div><div class=CToolTip id="tt13"><div class=CType>Creates an empty fieldset to contain other elements</div></div><div class=CToolTip id="tt14"><div class=CType>Creates an empty label element</div></div><div class=CToolTip id="tt15"><div class=CType>Creates a single radio button</div></div><div class=CToolTip id="tt16"><div class=CType>Creates a single checkbox</div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>